////////////////////////////////////////////////////////////////////////////
//
//  Crytek Engine Source File.
//  Copyright (C), Crytek Studios, 2002.
// -------------------------------------------------------------------------
//  File name:   toolsconfigpage.h
//  Version:     v1.00
//  Created:     27/11/2002 by Timur.
//  Compilers:   Visual Studio.NET
//  Description: 
// -------------------------------------------------------------------------
//  History:
//
////////////////////////////////////////////////////////////////////////////

#ifndef __toolsconfigpage_h__
#define __toolsconfigpage_h__
#pragma once

#include "Controls/ColorEditListBox.h"
#include "Controls/TooltipComboBox.h"

class CIconListDialog : public CDialog
{
public:
	CIconListDialog(CWnd *pParent = NULL);

	bool GetSelectedIconPath(CString& path) const;

	enum { IDD = IDD_ICON_LIST_DIALOG };
protected:
	virtual void DoDataExchange(CDataExchange* pDX);
	virtual BOOL OnInitDialog();
	virtual void OnOK();

	DECLARE_MESSAGE_MAP()

	CListCtrl m_iconListCtrl;
	CImageList m_iconImages;
	std::vector<CString> m_iconFiles;
	CString m_selectedIconPath;
};

/** Tools configuration property page.
*/
class CToolsConfigPage : public CXTResizePropertyPage
{
	DECLARE_DYNAMIC(CToolsConfigPage)

public:
	CToolsConfigPage();
	virtual ~CToolsConfigPage();

// Dialog Data
	enum { IDD = IDD_TOOLSCONFIG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnInitDialog();
	virtual void OnOK();
	virtual void OnCancel();
	
	afx_msg void OnSelchangeMacroList();
	afx_msg void OnSelchangeCommandList();
	afx_msg void OnSelchangeConsoleCommand();
	
	afx_msg void OnApplyEditorCommand();
	afx_msg void OnApplyConsoleCommand();
	afx_msg void OnAssignMacroShortcut();
	afx_msg void OnSelectMacroIcon();
	afx_msg void OnClearMacroIcon();

	afx_msg void OnNewMacroItem();
	afx_msg void OnPreNewCommandItem();
	afx_msg void OnNewCommandItem();

	afx_msg void OnMacroTitleEditEnd();

	afx_msg void OnMoveMacroItemUp();
	afx_msg void OnMoveMacroItemDown();
	afx_msg void OnMoveCommandItemUp();
	afx_msg void OnMoveCommandItemDown();

	afx_msg void OnDeleteMacroItem();
	afx_msg void OnDeleteCommandItem();

	DECLARE_MESSAGE_MAP()

	//////////////////////////////////////////////////////////////////////////
	// Vars.
	//////////////////////////////////////////////////////////////////////////
	CButton m_toggleVar;
	CButton m_applyEditorCommand;
	CButton m_applyConsoleCommand;
	CButton m_assignShortcut;
	CButton m_selectIcon, m_clearIcon;
	CColorEditListBox m_macroList;
	CColorEditListBox m_commandList;
	CTooltipComboBox m_editorCmd;
	CTooltipComboBox m_consoleCmd;
	CXTPShortcutManager::CKeyAssign m_macroShortcutKey;
	CStatic m_macroIcon;

	COLORREF DetermineCommandItemColor(int index) const;
};

#endif // __toolsconfigpage_h__